package com.poly.system;

import com.poly.common.core.constant.ServiceNameConstants;
import com.poly.common.core.domain.R;
import com.poly.system.domain.SysRole;
import com.poly.system.factory.RemoteRoleFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 角色服务
 * 
 * @author Yang huijing
 */
@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteRoleFallbackFactory.class)
public interface RemoteRoleService
{

    /**
     * 获取角色列表
     */
    @GetMapping(value = "/role/getRoleListByUserId")
    R<List<SysRole>> getRoleListByUserId(@RequestParam("userId") Long userId);

    /**
     * 获取角色
     */
    @GetMapping(value = "/role/getRoleByRoleId")
    R<SysRole> getRoleByRoleId(@RequestParam("roleId") Long roleId);

}
